package com.huanzhidadi.single.overloadandoverride;

public class OverrideClass extends OverloadClass {

    /**
     * Override注解会判断你是否正确的重写了父类的对应方法,如果写错了，程序会提示错误
     * 重写时方法名，方法返回值，方法入参都要与父类被重写方法保持一致
     * @param name
     * @param age
     */
    @Override
    public void testOverload(String name, Integer age) {
        System.out.println("子类：" + name + ", " + age);
    }

    public static void main(String[] args) {
        OverrideClass overrideClass = new OverrideClass();
        overrideClass.testOverload("test", 35);
    }
}
